package vno.fux.ui
{
	import flash.events.Event;
	
	import org.aswing.ASFont;
	
	import vno.fux.BasePoint;
	import vno.fux.CompassDirection;
	import vno.fux.GlobalVar;
	import vno.sci.event.MonologEvent;
	import vno.sci.window.SimpleMessageBox;
	import flash.filters.BlurFilter;

	public class MessageWindowView extends BaseComponentView
	{
		private var _windowCore:SimpleMessageBox;
		public function MessageWindowView(model_:BaseComponentModel, controller_:BaseComponentController)
		{
			super(model_, controller_);
			var model:MessageWindowModel = _model as MessageWindowModel;
			_windowCore = new SimpleMessageBox(model.title, model.content, 450, 200);
			_windowCore.setFont(new ASFont("Tahoma", 16));
			this.content = _windowCore;
			//this.alpha = 0.8;
			//var dialogPackage:BaseDisplayObject = new BaseDisplayObject(dialog, CompassDirection.SE);
			this.x = GlobalVar.stage.stageWidth/2;
			this.y = GlobalVar.stage.stageHeight/2;
			this.setRegPoint(new BasePoint(_windowCore.frame.width/2, _windowCore.frame.height/2));
			_windowCore.addEventListener(vno.sci.event.MonologEvent.CLOSING, closeHandler);
		}		
		
		private function closeHandler(event:MonologEvent):void
		{
			removeChildren();
			dispatchEvent(event);
		}
		override public function update(evt:Event):void
		{
			this.x = _model.pos.x;
			this.y = _model.pos.y;
		}
	}
}